# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Maintainer: T.J. Townsend <blakkheim@archlinux.org>
# Contributor: Alexander F Rødseth <xyproto@archlinux.org>
# Contributor: SanskritFritz (gmail)
# Contributor: Tobias T. <OldShatterhand at gmx-topmail dot de>

pkgname=bibletime
_commit=48ccda7618ad7512ca481fc088dc53a9c692a5d6 # git rev-parse v$pkgver
pkgver=3.0.3
pkgrel=2
pkgdesc='Bible study tool'
arch=('loong64' 'x86_64')
url='https://www.bibletime.info/'
license=('GPL2')
depends=('sword' 'clucene' 'qt5-webengine' 'qt5-svg')
makedepends=('cmake' 'docbook-xsl' 'expac' 'fop' 'git' 'ninja' 'po4a' 'qt5-tools')
source=("git+https://github.com/bibletime/bibletime.git?signed#tag=$_commit")
sha256sums=('SKIP')
validpgpkeys=('6C0462117260CA4934F7B3E049D76194699FD9A4') # Jaak Ristioja

build() {
  local _xsl_shared=/usr/share/xml/docbook/xsl-stylesheets-$(expac %v docbook-xsl | cut -d - -f 1)
  cmake -B build -G Ninja $pkgname \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBT_DOCBOOK_XSL_HTML_CHUNK_XSL=$_xsl_shared/html/chunk.xsl \
    -DBUILD_HANDBOOK_PDF=OFF \
    -DBUILD_HOWTO_PDF=OFF \
    -Wno-dev
  ninja -C build
}

package() {
  DESTDIR="$pkgdir" ninja -C build install
}

# vim:set ts=2 sw=2 et:
